<template>
	<view>
		<view>下拉刷新</view>
		<view>
			<button @click="changeData" type="primary">点击下拉</button>
		</view>
		<view class="box_item" v-for="item in arrdata">{{item}}</view>
		
	</view>
</template>

<script>
	export default {
		onPullDownRefresh(){
			console.log("监测到了下拉刷新")
			setTimeout(()=>{
				this.arrdata=["python","vue","java","mysql"]
				uni.stopPullDownRefresh()
			},2000)
			
		},
			
		onReachBottom(){
			console.log("页面触底了...")
			this.arrdata=[...this.arrdata,...["java","mysql","python","vue"]]
		},
		data() {
			return {
				arrdata:["java","mysql","python","vue","java","mysql","python","vue"]
				
			}
		},
		methods: {
			changeData(){
				uni.startPullDownRefresh({
					success() {
						console.log("调用成功")
					}
				})			
}
		}
	}
</script>

<style>
	.box_item{
		height: 80px;
		line-height: 80px;
	}
</style>
